package com.huawei.hms.a.a.a;

import com.huawei.hms.common.ApiException;
import com.huawei.hms.common.internal.AnyClient;
import com.huawei.hms.common.internal.ResponseErrorCode;
import com.huawei.hms.common.internal.TaskApiCall;
import com.huawei.hms.support.api.client.Status;
import o.fjx;

public class f extends TaskApiCall<c, Void> {
    public /* synthetic */ void doExecute(AnyClient anyClient, ResponseErrorCode responseErrorCode, String str, fjx o_fjx) {
        a((c) anyClient, responseErrorCode, str, o_fjx);
    }

    public f(String str, String str2) {
        super(str, str2);
    }

    protected void a(c cVar, ResponseErrorCode responseErrorCode, String str, fjx<Void> o_fjx_java_lang_Void) {
        e b = e.b(str);
        Integer a = b.a();
        String b2 = b.b();
        if (a == null) {
            a = Integer.valueOf(responseErrorCode.getErrorCode());
            b2 = responseErrorCode.getErrorReason();
        }
        if (a(responseErrorCode, b.a())) {
            o_fjx_java_lang_Void.ॱ(null);
        } else {
            o_fjx_java_lang_Void.ॱ(new ApiException(new Status(a.intValue(), b2)));
        }
    }

    private boolean a(ResponseErrorCode responseErrorCode, Integer num) {
        if (num == null) {
            if (responseErrorCode.getStatusCode() == 0) {
                return true;
            }
            return false;
        } else if (num.intValue() != 0) {
            return false;
        } else {
            return true;
        }
    }
}
